package org.apache.rocketmq.client.java.clientapis.producer;

import org.apache.rocketmq.client.java.clientapis.ClientException;
import org.apache.rocketmq.client.java.clientapis.message.Message;

import java.io.Closeable;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;


public interface Producer extends Closeable {

    SendReceipt send(Message message) throws ClientException;

    SendReceipt send(Message message, Transaction transaction) throws ClientException;

    CompletableFuture<SendReceipt> sendAsync(Message message);

    Transaction beginTransaction() throws ClientException;

    @Override
    void close() throws IOException;
}
